#pragma once
#include "HashTable.h"

namespace my_stl
{
    template <class K, class Hashfunn = defultfunc<K>>
    class unordered_set
    {
        struct setkeyof
        {
            const K &operator()(const K &key)
            {
                return key;
            }
        };

    public:
        typedef typename HashTable<K, K, Hashfunn, setkeyof>::iterator iterator;
        iterator find(const K &key)
        {
            return set_table.find(key);
        }
        pair<iterator, bool> insert(const K &key)
        {
            return set_table.insert(key);
        }
        bool erase(const K &key)
        {
            return set_table.erase(key);
        }
        iterator begin()
        {
            return set_table.begin();
        }
        iterator end()
        {
            return set_table.end();
        }

    private:
        HashTable<K, K, Hashfunn, setkeyof> set_table;
    };
}